package com.example.myapplication.engines;

import com.example.myapplication.entity.ResMsg;
import com.example.myapplication.entity.User;
import io.reactivex.Observable;

/**
 * @author sjh
 * @Description
 * @create 2022/3/9 16:30
 */
public class LoginEngine {
    public static Observable<ResMsg> login(String name, String password) {
        if (name.equals("test") && password.equals("123456")) {
            User test = new User(1, "test");
            return Observable.just(new ResMsg(test, 200, "登陆成功"));
        } else {
            return Observable.just(new ResMsg(null, 500, "登陆失败"));
        }
    }
}
